{% extends "base.html" %}
{% load staticfiles %}

{% block title %}
	图灵课程 - 试卷添加
{% endblock %}

{% block style %}
    <style type="text/css">
        .pre-scrollable{
            max-height: 340px;
            overflow-y: scroll;
        }
        .error_msg{
            color:red;
        }
    </style>
{% endblock %}

{% block content %}
<!--test log in-->

<div class="container" role="main" style="width: 350px;padding: 10px">
<div style="color: inherit; padding: 15px" align="center" >
    <form action="/OnlineExam/AddExamPaper/" method="POST" autocomplete="off">
        <h2 class="form-signin-heading" style="padding-bottom: 10px">AddExamPaper</h2>
        <table>

        <div class="item">
            <div  class="reg_mess">
                <span class="glyphicon glyphicon-user"></span>*科目名称:
            </div>
            <div class="reg_mess_input">
            {{ obj1.coursename }}
            <span id="user_remind" style="display:none;" class="error_msg1"></span>
            </div>

            {%  if obj1.errors.coursename %}
                <div id="user_error" class="error_msg">{{ obj1.errors.coursename.0 }}</div>
            {% endif %}
            <div class="clear"></div>
        </div>

        <div class="item"><div  class="reg_mess" >
        <span class="glyphicon glyphicon-lock"></span>*试卷名称:</div>
            <div class="reg_mess_input">
            {{ obj1.examname }}
            <div id="pwd_remind" class="error_msg1" style="display:none;"></div>
            </div>
            {%  if obj1.errors.examname %}
                <div id="pwd_error" class="error_msg">{{ obj1.errors.examname.0 }}</div>
            {% endif %}
            <div class="clear"></div>
        </div>

        <div class="item">
            <div  class="reg_mess">
                <span class="glyphicon glyphicon-user"></span>*考试时长（min）:
            </div>
            <div class="reg_mess_input">
            {{ obj1.examtime }}
            <span id="user_remind" style="display:none;" class="error_msg1"></span>
            </div>

            {%  if obj1.errors.examtime %}
                <div id="user_error" class="error_msg">{{ obj1.errors.examtime.0 }}</div>
            {% endif %}
            <div class="clear"></div>
        </div>
        
        <div class="item">
            <div  class="reg_mess">
                <span class="glyphicon glyphicon-user"></span>*题目数量:
            </div>
            <div class="reg_mess_input">
            {{ obj1.problemnum }}
            <span id="user_remind" style="display:none;" class="error_msg1"></span>
            </div>

            {%  if obj1.errors.problemnum %}
                <div id="user_error" class="error_msg">{{ obj1.errors.problemnum.0 }}</div>
            {% endif %}
            <div class="clear"></div>
        </div>
        
         <div class="item">
            <div  class="reg_mess">
                <span class="glyphicon glyphicon-user"></span>*总分:
            </div>
            <div class="reg_mess_input">
            {{ obj1.totalscore }}
            <span id="user_remind" style="display:none;" class="error_msg1"></span>
            </div>

            {%  if obj1.errors.totalscore %}
                <div id="user_error" class="error_msg">{{ obj1.errors.totalscore.0 }}</div>
            {% endif %}
            <div class="clear"></div>
        </div>       

        <div class="item">
            <div  class="reg_mess">
                <span class="glyphicon glyphicon-user"></span>备注:
            </div>
            <div class="reg_mess_input">
            {{ obj1.note }}
            <span id="user_remind" style="display:none;" class="error_msg1"></span>
            </div>

            {%  if obj1.errors.note %}
                <div id="user_error" class="error_msg">{{ obj1.errors.note.0 }}</div>
            {% endif %}
            <div class="clear"></div>
        </div>

        <div class="item">
            {%  if obj1.non_field_errors %}
                {% for item in obj1.non_field_errors %}
                    <div class="error_msg">{{ item }}</div>
                {% endfor %}
            {% endif %}
            <div class="clear"></div>
        </div>


        <div style="margin-padding: 20px">
            <tr>
                <td>
                    <p style="width=15px">&nbsp;</p>
                </td>
                <td>
                    <input value="添加单选题" class="btn btn-sm btn-primary btn-block" type="submit" style="background-color: #b07675; border:none;font-size: 14px;" name="submit">
                    <input value="添加判断题" class="btn btn-sm btn-primary btn-block" type="submit" style="background-color: #b07675; border:none;font-size: 14px;" name="submit">
                </td>
            </tr>
        </div>

        </table>
    </form>
</div>
</div>




{% endblock %}

{% block other_script %}

<script type="text/javascript" src="/static/js/account.js"></script>
<script type="text/javascript">
	$('#form-login').one('submit', function() {
		console.log("clicked");
		$(this).find('input[type="submit"]').attr('disabled','disabled');
	});
</script>
{% endblock %}
